﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.sim {
    import Engine.Helpers.*;
    import Classes.*;
    import Transactions.*;
    import Classes.util.*;
    import Modules.stats.experiments.*;

    public class NotificationStateObserver implements IPlayerStateObserver, IGameWorldStateObserver, IGameWorldUpdateObserver, IPopulationStateObserver {

        private var m_gremlinsGameQuestStarted:Boolean = false;
        private var m_lastObservedEnergy:int = 0;

        public function NotificationStateObserver(_arg1:GameWorld){
            _arg1.addObserver(this);
            Global.player.addObserver(this);
        }
        public function levelChanged(_arg1:int):void{
        }
        public function xpChanged(_arg1:int):void{
        }
        public function commodityChanged(_arg1:int, _arg2:String):void{
            if (_arg2 == "goods"){
                if (_arg1 <= 10){
                    Global.ui.showTickerMessage(ZLoc.t("Main", "TickerLowGoods"));
                };
            };
        }
        public function energyChanged(_arg1:Number):void{
            var _local2:Number = Global.gameSettings.getInt("energyWarningAmount", 10);
            if (_arg1 <= Global.gameSettings.getInt("energyWarningAmount", 10)){
                Global.ui.showTickerMessage(ZLoc.t("Main", "TickerLowEnergy"));
            };
            var _local3:int = Global.experimentManager.getVariant(ExperimentDefinitions.EXPERIMENT_APRILFOOLS2011);
            if (((((!(this.m_gremlinsGameQuestStarted)) && ((_arg1 < this.m_lastObservedEnergy)))) && ((_local3 == ExperimentDefinitions.APRILFOOLS2011_ENABLED)))){
                this.m_gremlinsGameQuestStarted = true;
                GameTransactionManager.addTransaction(new TStartManualQuest("qm_gremlinsminigame"), true);
            };
            if (!isNaN(_arg1)){
                this.m_lastObservedEnergy = _arg1;
            };
        }
        public function goldChanged(_arg1:int):void{
        }
        public function cashChanged(_arg1:int):void{
        }
        public function initialize():void{
        }
        public function cleanUp():void{
        }
        public function onGameLoaded(_arg1:Object):void{
        }
        public function onResourceChange(_arg1:MapResource, _arg2:Vector3, _arg3:Vector3):void{
        }
        public function update(_arg1:Number):void{
        }
        public function onPopulationInit(_arg1:int, _arg2:int, _arg3:int):void{
        }
        public function onPopulationChanged(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
        }
        public function onPotentialPopulationChanged(_arg1:int, _arg2:int):void{
        }
        public function onPopulationCapChanged(_arg1:int):void{
        }

    }
}//package Classes.sim 
